package cn.bdqn.t354.dao;

import cn.bdqn.t354.entity.User;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.List;

@SpringBootTest
@RunWith(SpringRunner.class)
public class UserDaoFuntionTester {
    @Resource
    UserDao userDao;

    //3.方法名规则查询
    @Test
    public void testfindByUsrRoleId(){
        List<User> list = userDao.findByUsrRoleId(2l);
        for (User user : list) {
            System.out.println(user);
        }
    }

    @Test
    public void testfindByUsrNameLike(){
        List<User> list = userDao.findByUsrNameLike("%d%");
        for (User user : list) {
            System.out.println(user);
        }
    }

    @Test
    public void testfindByUsrNameAndUsrPassword(){
        User user = userDao.findByUsrNameAndUsrPassword("dajun","123456");
        System.out.println(user);
    }
}
